package cn.cys.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author: yiShan chen
 * @Date: 2023/3/31 13:54
 */
@Data
@Component("ipCountProperties")
@ConfigurationProperties(prefix = "ip-count")
public class IpCountProperties {
    /**
     * 日志显示周期
     */
    private Long cycle = 5L;
    /**
     * 是否周期内重置数据
     */
    private Boolean cycleReset = false;
    /**
     * 日志输出模式  detail：详细模式  simple：极简模式
     */
    private String model = ModelEnum.DETAIL.getValue();

    /**
     * 日志输出模式枚举
     */
    public enum ModelEnum {
        DETAIL("detail"),
        SIMPLE("simple");

        private final String value;

        ModelEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }
}
